﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TweetRating
{
    public class Graficador
    {
        public string graficarRating(List<MedicionDeRating> programasConRating)
        {
            string programas = "";
            programasConRating.ForEach(unaMedicion => programas += "%0D%0A" + unaMedicion.programa.nombre);
            programas = programas.Substring(6, programas.Length - 6);

            string ratings = "";
            programasConRating.ForEach(unaMedicion => ratings += "%0D%0A" + unaMedicion.rating);
            ratings = ratings.Substring(6, ratings.Length - 6);

            return "http://www.chartgo.com/create.do?chart=bar&width=500&height=400&orientation=vertical&title=Rating&subtitle=&xtitle=Programa&ytitle=Rating&source=&fonttypetitle=bold&fonttypelabel=normal&labelorientation=horizontal&chrtbkgndcolor=gradientblue&max_yaxis=&labels=1&min_yaxis=&gradient=1&roundedge=1&shadow=1&border=1&xaxis1=" + programas + "&yaxis1=" + ratings + "&group1=Group+1&add=&rem=&from=generaljsp&lang=es";
        }
    }
}
